# var
  # usr
    set $term alacritty
    set $browser $BROWSER
    set $fm $FILES

  # wm
    set $super mod4
    set $runner wofi --show run
    set $notify swaync

  # win
    for_window [title="Color Picker"] floating enable
  
  # theme
    set $font IBM Plex Sans 10
    set $bg ~/pictures/pape/kurichair.jpg
    set $bar waybar

  # col
    include ~/.cache/wal/colors-sway
    set $color_primary $color2
    set $color_null #000000
    set $color_foreground #ffffff
    set $color_urgent #ff278d

# boot
  output * bg $bg fill scale 1.5
  exec $notify
  bar swaybar_command waybar
  exec --no-startup-id autotiling-rs
  exec emacs --daemon
  exec gammastep -l 38.89511:-77.03637

# vis
  # win
    default_border pixel 3
    default_floating_border pixel 3
    font pango:$font
    gaps inner 5
    gaps outer 7
    smart_borders on

  # col
    #client.focused "$color1" "$color1" "$color1" "$color_foreground"
    client.focused "#6f5c8a" "#6f5c8a" "#6f5c8a" "$color_foreground"
    client.focused_inactive "$color_null" "$color_null" "$color_null" "$color_null"
    client.unfocused "#2c2c2c" "#2b2b2b" "#888888" "#000000" "#000000"

# sys
  # func
    exec swayidle -w {
      timeout 1000 'swaylock' \
      timeout 1500 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
      before-sleep 'swaylock'
      lock 'swaylock'
    }
    bindswitch --reload lid:on swaylock'

# bind
  # win
    # usr
    bindsym $super+e exec emacsclient -c
    bindsym $super+d exec $runner
    bindsym $super+Return exec $term

      # ss
      bindsym $super+p exec grimshot --notify save output ~/pictures/ss/$(date +%b-%d_%H-%M-%S).png
      bindsym Print+Shift exec grimshot --notify save area ~/pictures/ss/$(date +%b-%d_%H-%M-%S).png
    
    # sway
      floating_modifier $super
      bindsym $super+b border toggle
      bindsym $super+x kill
      bindsym $super+Shift+c reload
      bindsym $super+Shift+b exec killall -SIGUSR1 waybar 
      #bindsym $super+Shift+e exec $powermenu
      bindsym $super+Shift+s sticky enable

      bindsym $super+Left focus left
      bindsym $super+Down focus down
      bindsym $super+Up focus up
      bindsym $super+Right focus right

      bindsym $super+Shift+Left move left
      bindsym $super+Shift+Down move down
      bindsym $super+Shift+Up move up
      bindsym $super+Shift+Right move right

    bindsym $super+1 workspace 1
    bindsym $super+2 workspace 2
    bindsym $super+3 workspace 3
    bindsym $super+4 workspace 4
    bindsym $super+5 workspace 5
    bindsym $super+6 workspace 6
    bindsym $super+7 workspace 7
    bindsym $super+8 workspace 8
    bindsym $super+9 workspace 9
    bindsym $super+0 workspace 0

    bindsym $super+Shift+1 move container to workspace 1
    bindsym $super+Shift+2 move container to workspace 2
    bindsym $super+Shift+3 move container to workspace 3
    bindsym $super+Shift+4 move container to workspace 4
    bindsym $super+Shift+5 move container to workspace 5
    bindsym $super+Shift+6 move container to workspace 6
    bindsym $super+Shift+7 move container to workspace 7
    bindsym $super+Shift+8 move container to workspace 8
    bindsym $super+Shift+9 move container to workspace 9
    bindsym $super+Shift+0 move container to workspace 0

    bindsym $super+Shift+bracketleft move workspace prev
    bindsym $super+Shift+bracketright move workspace next

  # util
    bindsym $super+h splitt
    bindsym $super+s layout toggle all
    bindsym $super+Shift+f fullscreen
    bindsym $super+space floating toggle
    bindsym $super+Shift+space focus mode_toggle
    bindsym $super+minus move scratchpad
    bindsym $super+Shift+minus scratchpad show, floating toggle
    #bindsym $super+Shift+g gaps toggle

  # bright
    bindsym XF86MonBrightnessUp exec sudo light -A 5
    bindsym XF86MonBrightnessDown exec sudo light -U 5

  # vol
    bindsym XF86AudioRaiseVolume exec pactl set-sink-volume alsa_output.pci-0000_04_00.6.analog-stereo +2%
    bindsym XF86AudioLowerVolume exec pactl set-sink-volume alsa_output.pci-0000_04_00.6.analog-stereo -2% 
    bindsym XF86AudioMute exec pactl set-sink-mute alsa_output.pci-0000_04_00.6.analog-stereo toggle && notify-send "$(pactl get-source-mute alsa_input.pci-0000_04_00.6.analog-stereo)"

  # func
    mode "󰘖" {
      bindsym Left resize shrink width 10px
      bindsym Down resize grow height 10px
      bindsym Up resize shrink height 10px
      bindsym Right resize grow width 10px

      bindsym Return mode "default"
      bindsym Escape mode "default"
    }
    bindsym $super+r mode "󰘖"

    mode "󰘠" {
      bindsym Left move left 10px
      bindsym Down move down 10px
      bindsym Up move up 10px
      bindsym Right move right 10px
      
      bindsym Return mode "default"
      bindsym Escape mode "default"
    }
    bindsym $super+m mode "󰘠"

    mode "󰘕" {
      bindsym Left gaps outer current minus 1px
      bindsym Down gaps inner current plus 1px
      bindsym Up gaps inner current minus 1px
      bindsym Right gaps outer current plus 1px
      
      bindsym Return mode "default"
      bindsym Escape mode "default"
    }
    bindsym $super+g mode "󰘕"
